// 创建本地存储
const TokenKey = 'SHOPPING_template_token'
const userInfo = 'SHOPPING_INFO_KEY'

// 个人信息本地存储
export const setUserInfo = (value) => {
  return localStorage.setItem(userInfo, JSON.stringify(value))
}
export const getUserInfo = () => {
  return JSON.parse(localStorage.getItem(userInfo))
}
export const removeUserInfo = () => {
  return localStorage.removeItem(userInfo)
}

// token
export function getToken () {
  return JSON.parse(localStorage.getItem(TokenKey))
}

export function setToken (token) {
  return localStorage.setItem(TokenKey, JSON.stringify(token))
}

export function removeToken () {
  return localStorage.removeItem(TokenKey)
}
